package com.compass.mobile.ui.adapter

import android.view.LayoutInflater
import android.view.ViewGroup
import com.compass.mobile.databinding.LayoutImgItemBinding
import com.compass.mobile.framework.adapter.BaseBindViewHolder
import com.compass.mobile.framework.adapter.BaseRecyclerViewAdapter
import dp2px
import setUrlRound

/**
 * Description：
 * Date:2024/6/20 20:58
 */
class GridImageAdapter : BaseRecyclerViewAdapter<String, LayoutImgItemBinding>() {
    override fun onBindDefViewHolder(
        holder: BaseBindViewHolder<LayoutImgItemBinding>,
        item: String?,
        position: Int
    ) {
        if (item == null) return
        holder.binding.apply {
            fiv.setUrlRound(item, dp2px(5f))
        }
    }

    override fun getViewBinding(
        layoutInflater: LayoutInflater,
        parent: ViewGroup,
        viewType: Int
    ): LayoutImgItemBinding {
        return LayoutImgItemBinding.inflate(layoutInflater, parent, false)
    }
}